home *** CD-ROM | disk | FTP | other *** search
/ Chip 2007 January, February, March & April / Chip-Cover-CD-2007-02.iso / Pakiet bezpieczenstwa / mini Pentoo LiveCD 2006.1 / mpentoo-2006.1.iso / livecd.squashfs / usr / lib / mozilla-firefox / include / content / nsIScriptLoader.h < prev    next >
C/C++ Source or Header  |  2006-05-08  |  8KB  |  221 lines

  1. /*
  2.  * DO NOT EDIT.  THIS FILE IS GENERATED FROM nsIScriptLoader.idl
  3.  */
  4.  
  5. #ifndef __gen_nsIScriptLoader_h__
  6. #define __gen_nsIScriptLoader_h__
  7.  
  8.  
  9. #ifndef __gen_nsISupports_h__
  10. #include "nsISupports.h"
  11. #endif
  12.  
  13. /* For IDL files that don't want to include root IDL files. */
  14. #ifndef NS_NO_VTABLE
  15. #define NS_NO_VTABLE
  16. #endif
  17. class nsIDocument; /* forward declaration */
  18.  
  19. class nsIScriptElement; /* forward declaration */
  20.  
  21. class nsIScriptLoaderObserver; /* forward declaration */
  22.  
  23.  
  24. /* starting interface:    nsIScriptLoader */
  25. #define NS_ISCRIPTLOADER_IID_STR "339a4eb5-dac6-4034-8c43-f4f8c645ce57"
  26.  
  27. #define NS_ISCRIPTLOADER_IID \
  28.   {0x339a4eb5, 0xdac6, 0x4034, \
  29.     { 0x8c, 0x43, 0xf4, 0xf8, 0xc6, 0x45, 0xce, 0x57 }}
  30.  
  31. class NS_NO_VTABLE nsIScriptLoader : public nsISupports {
  32.  public: 
  33.  
  34.   NS_DEFINE_STATIC_IID_ACCESSOR(NS_ISCRIPTLOADER_IID)
  35.  
  36.   /**
  37.    * Initialize loader with a document. The container of this document
  38.    * will be used for getting script evaluation information, including
  39.    * the context in which to do the evaluation. The loader maintains a 
  40.    * strong reference to the document.
  41.    *
  42.    * @param aDocument The document to use as the basis for script
  43.    *        processing.
  44.    */
  45.   /* void init (in nsIDocument aDocument); */
  46.   NS_IMETHOD Init(nsIDocument *aDocument) = 0;
  47.  
  48.   /**
  49.    * The loader maintains a strong reference to the document with
  50.    * which it is initialized. This call forces the reference to
  51.    * be dropped.
  52.    */
  53.   /* void dropDocumentReference (); */
  54.   NS_IMETHOD DropDocumentReference(void) = 0;
  55.  
  56.   /**
  57.    * Add an observer for all scripts loaded through this loader.
  58.    *
  59.    * @param aObserver observer for all script processing.
  60.    */
  61.   /* void addObserver (in nsIScriptLoaderObserver aObserver); */
  62.   NS_IMETHOD AddObserver(nsIScriptLoaderObserver *aObserver) = 0;
  63.  
  64.   /**
  65.    * Remove an observer.
  66.    *
  67.    * @param aObserver observer to be removed
  68.    */
  69.   /* void removeObserver (in nsIScriptLoaderObserver aObserver); */
  70.   NS_IMETHOD RemoveObserver(nsIScriptLoaderObserver *aObserver) = 0;
  71.  
  72.   /**
  73.    * Process a script element. This will include both loading the 
  74.    * source of the element if it is not inline and evaluating
  75.    * the script itself.
  76.    *
  77.    * @param aElement The element representing the script to be loaded and
  78.    *        evaluated.
  79.    * @param aObserver An observer for this script load only
  80.    *
  81.    */
  82.   /* void processScriptElement (in nsIScriptElement aElement, in nsIScriptLoaderObserver aObserver); */
  83.   NS_IMETHOD ProcessScriptElement(nsIScriptElement *aElement, nsIScriptLoaderObserver *aObserver) = 0;
  84.  
  85.   /**
  86.    * Gets the currently executing script. This is useful if you want to
  87.    * generate a unique key based on the currently executing script.
  88.    */
  89.   /* nsIScriptElement getCurrentScript (); */
  90.   NS_IMETHOD GetCurrentScript(nsIScriptElement **_retval) = 0;
  91.  
  92.   /**
  93.    * Whether the loader is enabled or not.
  94.    * When disabled, processing of new script elements is disabled. 
  95.    * Any call to processScriptElement() will fail with a return code of
  96.    * NS_ERROR_NOT_AVAILABLE. Note that this DOES NOT disable
  97.    * currently loading or executing scripts.
  98.    */
  99.   /* attribute boolean enabled; */
  100.   NS_IMETHOD GetEnabled(PRBool *aEnabled) = 0;
  101.   NS_IMETHOD SetEnabled(PRBool aEnabled) = 0;
  102.  
  103. };
  104.  
  105. /* Use this macro when declaring classes that implement this interface. */
  106. #define NS_DECL_NSISCRIPTLOADER \
  107.   NS_IMETHOD Init(nsIDocument *aDocument); \
  108.   NS_IMETHOD DropDocumentReference(void); \
  109.   NS_IMETHOD AddObserver(nsIScriptLoaderObserver *aObserver); \
  110.   NS_IMETHOD RemoveObserver(nsIScriptLoaderObserver *aObserver); \
  111.   NS_IMETHOD ProcessScriptElement(nsIScriptElement *aElement, nsIScriptLoaderObserver *aObserver); \
  112.   NS_IMETHOD GetCurrentScript(nsIScriptElement **_retval); \
  113.   NS_IMETHOD GetEnabled(PRBool *aEnabled); \
  114.   NS_IMETHOD SetEnabled(PRBool aEnabled); 
  115.  
  116. /* Use this macro to declare functions that forward the behavior of this interface to another object. */
  117. #define NS_FORWARD_NSISCRIPTLOADER(_to) \
  118.   NS_IMETHOD Init(nsIDocument *aDocument) { return _to Init(aDocument); } \
  119.   NS_IMETHOD DropDocumentReference(void) { return _to DropDocumentReference(); } \
  120.   NS_IMETHOD AddObserver(nsIScriptLoaderObserver *aObserver) { return _to AddObserver(aObserver); } \
  121.   NS_IMETHOD RemoveObserver(nsIScriptLoaderObserver *aObserver) { return _to RemoveObserver(aObserver); } \
  122.   NS_IMETHOD ProcessScriptElement(nsIScriptElement *aElement, nsIScriptLoaderObserver *aObserver) { return _to ProcessScriptElement(aElement, aObserver); } \
  123.   NS_IMETHOD GetCurrentScript(nsIScriptElement **_retval) { return _to GetCurrentScript(_retval); } \
  124.   NS_IMETHOD GetEnabled(PRBool *aEnabled) { return _to GetEnabled(aEnabled); } \
  125.   NS_IMETHOD SetEnabled(PRBool aEnabled) { return _to SetEnabled(aEnabled); } 
  126.  
  127. /* Use this macro to declare functions that forward the behavior of this interface to another object in a safe way. */
  128. #define NS_FORWARD_SAFE_NSISCRIPTLOADER(_to) \
  129.   NS_IMETHOD Init(nsIDocument *aDocument) { return !_to ? NS_ERROR_NULL_POINTER : _to->Init(aDocument); } \
  130.   NS_IMETHOD DropDocumentReference(void) { return !_to ? NS_ERROR_NULL_POINTER : _to->DropDocumentReference(); } \
  131.   NS_IMETHOD AddObserver(nsIScriptLoaderObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->AddObserver(aObserver); } \
  132.   NS_IMETHOD RemoveObserver(nsIScriptLoaderObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->RemoveObserver(aObserver); } \
  133.   NS_IMETHOD ProcessScriptElement(nsIScriptElement *aElement, nsIScriptLoaderObserver *aObserver) { return !_to ? NS_ERROR_NULL_POINTER : _to->ProcessScriptElement(aElement, aObserver); } \
  134.   NS_IMETHOD GetCurrentScript(nsIScriptElement **_retval) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetCurrentScript(_retval); } \
  135.   NS_IMETHOD GetEnabled(PRBool *aEnabled) { return !_to ? NS_ERROR_NULL_POINTER : _to->GetEnabled(aEnabled); } \
  136.   NS_IMETHOD SetEnabled(PRBool aEnabled) { return !_to ? NS_ERROR_NULL_POINTER : _to->SetEnabled(aEnabled); } 
  137.  
  138. #if 0
  139. /* Use the code below as a template for the implementation class for this interface. */
  140.  
  141. /* Header file */
  142. class nsScriptLoader : public nsIScriptLoader
  143. {
  144. public:
  145.   NS_DECL_ISUPPORTS
  146.   NS_DECL_NSISCRIPTLOADER
  147.  
  148.   nsScriptLoader();
  149.  
  150. private:
  151.   ~nsScriptLoader();
  152.  
  153. protected:
  154.   /* additional members */
  155. };
  156.  
  157. /* Implementation file */
  158. NS_IMPL_ISUPPORTS1(nsScriptLoader, nsIScriptLoader)
  159.  
  160. nsScriptLoader::nsScriptLoader()
  161. {
  162.   /* member initializers and constructor code */
  163. }
  164.  
  165. nsScriptLoader::~nsScriptLoader()
  166. {
  167.   /* destructor code */
  168. }
  169.  
  170. /* void init (in nsIDocument aDocument); */
  171. NS_IMETHODIMP nsScriptLoader::Init(nsIDocument *aDocument)
  172. {
  173.     return NS_ERROR_NOT_IMPLEMENTED;
  174. }
  175.  
  176. /* void dropDocumentReference (); */
  177. NS_IMETHODIMP nsScriptLoader::DropDocumentReference()
  178. {
  179.     return NS_ERROR_NOT_IMPLEMENTED;
  180. }
  181.  
  182. /* void addObserver (in nsIScriptLoaderObserver aObserver); */
  183. NS_IMETHODIMP nsScriptLoader::AddObserver(nsIScriptLoaderObserver *aObserver)
  184. {
  185.     return NS_ERROR_NOT_IMPLEMENTED;
  186. }
  187.  
  188. /* void removeObserver (in nsIScriptLoaderObserver aObserver); */
  189. NS_IMETHODIMP nsScriptLoader::RemoveObserver(nsIScriptLoaderObserver *aObserver)
  190. {
  191.     return NS_ERROR_NOT_IMPLEMENTED;
  192. }
  193.  
  194. /* void processScriptElement (in nsIScriptElement aElement, in nsIScriptLoaderObserver aObserver); */
  195. NS_IMETHODIMP nsScriptLoader::ProcessScriptElement(nsIScriptElement *aElement, nsIScriptLoaderObserver *aObserver)
  196. {
  197.     return NS_ERROR_NOT_IMPLEMENTED;
  198. }
  199.  
  200. /* nsIScriptElement getCurrentScript (); */
  201. NS_IMETHODIMP nsScriptLoader::GetCurrentScript(nsIScriptElement **_retval)
  202. {
  203.     return NS_ERROR_NOT_IMPLEMENTED;
  204. }
  205.  
  206. /* attribute boolean enabled; */
  207. NS_IMETHODIMP nsScriptLoader::GetEnabled(PRBool *aEnabled)
  208. {
  209.     return NS_ERROR_NOT_IMPLEMENTED;
  210. }
  211. NS_IMETHODIMP nsScriptLoader::SetEnabled(PRBool aEnabled)
  212. {
  213.     return NS_ERROR_NOT_IMPLEMENTED;
  214. }
  215.  
  216. /* End of implementation class template. */
  217. #endif
  218.  
  219.  
  220. #endif /* __gen_nsIScriptLoader_h__ */
  221.